cmake_minimum_required (VERSION 2.6) 
project (MBI)

set(Boost_USE_STATIC_LIBS OFF) 
set(Boost_USE_MULTITHREADED OFF)  
set(Boost_USE_STATIC_RUNTIME OFF) 
find_package(Boost 1.49.0 COMPONENTS system thread) 

if(Boost_FOUND)

#INCLUDE BOOST
include_directories(${Boost_INCLUDE_DIRS})
                                                                                                                                                                                                                             
#INCLUDE GTEST to the build
add_subdirectory (external/gtest)
include_directories (external/gtest/include)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)

#INCLUDE DIRECTORIES
include_directories (${CMAKE_SOURCE_DIR}/include)
include_directories (${CMAKE_SOURCE_DIR}/external)

set( CMAKE_VERBOSE_MAKEFILE ON )
SET( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -O3 -Wall -Werror -pedantic -std=gnu++0x" )
SET( CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS}" )

#OUR LIBRARY
add_library(mbi_lib src/Mixer.cpp src/common.cpp src/MarkerUnifier.cpp src/ReadMixture.cpp src/ProfileGenerator.cpp src/Assertions.cpp src/UInt.cpp src/threads/MixTask.cpp) 

#OUR MAIN EXECUTABLE
add_executable(mbi src/main.cpp )
target_link_libraries(mbi mbi_lib ${Boost_LIBRARIES})

#TEST PROJECT
add_executable(mbi_test test/test.cpp test/Mixer_test.cpp test/MarkerUnifier_test.cpp test/ReadMixture_test.cpp test/ProfileGenerator_test.cpp test/MixTask_test.cpp test/UIntTest_test.cpp)
target_link_libraries(mbi_test gtest_main mbi_lib ${Boost_LIBRARIES})
endif()
